@boxShadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12) !important;

.prevent-hiding-scrollbar-in-mac() {
    &::-webkit-scrollbar {
        width: 15px;
        height: 15px;
    }

    &::-webkit-scrollbar-track {
        background-color: white;
    }

    &::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border: 3px solid transparent;
        border-radius: 8px;
        background-clip: padding-box;

        &:hover {
            background-color: #7d7d7d;
        }
    }
}

.designare-table {
    display: flex !important;
    flex-direction: column !important;
    background-color: white;
    box-shadow: @boxShadow;

    table, tr, tbody, thead, th, td {
        background-color: inherit;
    }

    table {
        border-collapse: separate !important;
        border-spacing: 0px 0px !important;
        border-color: transparent !important;
        border-width: 0px !important;

        thead, tbody {
            border-color:inherit;

            tr {
                border-width: 1px !important;
                border-style: solid;
                border-color: inherit;

                th,
                td {
                    height: inherit !important;
                    position: relative;
                    padding-top: 0 !important;
                    padding-bottom: 0 !important;
                    padding-left: 16px;
                    padding-right: 16px;
                    border-width: 1px;
                    border-style: solid;
                    border-color:inherit;
                    border-right: none;
                    border-left: none;
                    border-top: none;
                    overflow: hidden !important;
                }

                th > span {
                    position: relative !important;
                    display: table-cell !important;
                    vertical-align: middle;
                }
            }

            tr:last-child {
                th {
                    border-bottom: none;
                }
            }
        }

        tbody {
            tr {
                border-top-color: rgba(0, 0, 0, 0);
                border-bottom-color:  rgba(0, 0, 0, 0.12);
                &:last-of-type {
                    border-bottom-color: transparent;
                }
            }
        }
    }

    &-filter {
        &.active, &:hover {
            background-color: rgba(0,0,0,0.03);
        }
    }

    &-fixed {
        &-header {
            position: relative;
            background-color: inherit;

            &.designare-mask {
                &::after{
                    content:"";
                    position: absolute;
                    height: 100%;
                    width: 18px;
                    background-color: inherit;
                    right: 0px;
                    top:0;
                    z-index: 1;
                }
            }
            border-left: none !important;
            border-right: none !important;
            border-bottom: 1px solid rgba(0, 0, 0, 0.12);
            > div {
                margin: -9px 0 -9px 0 !important; // hide header h scroll bar
                .prevent-hiding-scrollbar-in-mac();
            }
        }

        &-body {
            border-left: none !important;
            border-right: none !important;
            background-color: inherit;
        }
    }

    &-layer {
        &.designare-shadow {
            box-shadow: @boxShadow;
        }
    }

    // hide header scroll bar
    &-header,
    &-header-left,
    &-header-right {
        padding: 9px 0 !important;
        margin-bottom: -18px !important;

        &::-webkit-scrollbar {
            -webkit-appearance: none;
        }

        &::-webkit-scrollbar:horizontal {
            height: 18px;
        }
    }

    &-header {
        background-color: inherit;

        table {
            thead {
                tr {
                    td {
                        z-index: 1;
                    }
                }
            }
        }

        &-left {
            overflow: hidden;
            top:0;
            left:0;
            position: absolute;
            background-color: inherit;

            table {
                thead {
                    tr {
                        td {
                            z-index: 2;
                        }
                    }
                }
            }

            &.designare-shadow {
                .designare-fixed {
                    &::after {
                        content:' ';
                        display: block;
                        width: 2px;
                        position: absolute;
                        right: 0;
                        top:-1px;
                        background-image: 
                            linear-gradient(to right, rgba(9,9,9,.1), rgba(0,0,0,0));
                        pointer-events: none;
                        height: 500%;
                    }
                }
            }
            &::after { // mask
                content:'';
                display: block;
                width: 1px;
                position: absolute;
                left: 0;
                top: 0;
                bottom: 0;
                background-color: inherit;
                z-index: 1;
            }
        }
        &-right {
            overflow: hidden;
            top: 0;
            right: 0px;
            position: absolute;
            background-color: inherit;

            table {
                thead {
                    tr {
                        td {
                            z-index: 1;
                        }
                    }
                }
            }

            &.designare-shadow {
                .designare-fixed {
                    &::after {
                        content:' ';
                        display: block;
                        width: 2px;
                        position: absolute;
                        left: 0px;
                        top:-1px;
                        background-image: 
                            linear-gradient(to left, rgba(9,9,9,.1), rgba(0,0,0,0));
                        pointer-events: none;
                        height: 500%;
                    }
                }
            }
            &::after { // mask
                content:' ';
                display: block;
                width: 1px;
                position: absolute;
                right: 0;
                top: 0;
                bottom: 0;
                background-color: inherit;
                z-index: 1;
            }
        }
    }


    &-body {
        background-color: inherit;
        position: relative;

        .prevent-hiding-scrollbar-in-mac();

        table {
            tbody {
                tr {
                    td {
                        z-index: 1;
                    }
                }
            }
        }

        &-left {
            position: absolute;
            background-color: inherit;
            top: 0;
            left: 0px;
            bottom: 15px;
            overflow: hidden;
            height: 100%;

            > div {
                .prevent-hiding-scrollbar-in-mac();
            }

            table {
                tbody {
                    tr {
                        td {
                            z-index: 2;
                        }
                    }
                }
            }
            

            &.designare-shadow {
                .designare-fixed {
                    &::after {
                        content:'';
                        display: block;
                        width: 2px;
                        position: absolute;
                        right: 0;
                        top:-1px;
                        background-image:
                            linear-gradient(to right, rgba(9,9,9,.1), rgba(0,0,0,0));
                        pointer-events: none;
                        height: 500%;
                    }
                }
            }
            &::after { // mask
                content:'';
                display: block;
                width: 1px;
                position: absolute;
                left: 0;
                top: 0;
                bottom: 0;
                background-color: inherit;
                z-index: 1;
            }
        }

        &-right {
            position: absolute;
            right: 0px;
            top: 0;
            bottom: 15px;
            overflow: hidden;
            height: 100%;
            background-color: inherit;

            > div {
                .prevent-hiding-scrollbar-in-mac();
            }

            table {
                tbody {
                    tr {
                        td {
                            z-index: 1;
                        }
                    }
                }
            }

            &.designare-shadow {
                .designare-fixed {
                    &::after {
                        content:'';
                        display: block;
                        width: 2px;
                        position: absolute;
                        left: 0;
                        top:-1px;
                        background-image: 
                            linear-gradient(to left, rgba(9,9,9,.1), rgba(0,0,0,0));
                        pointer-events: none;
                        height: 500%;
                    }
                }
            }
            &::after { // mask
                content:'';
                display: block;
                width: 1px;
                position: absolute;
                right: 0;
                top: 0;
                bottom: 0;
                background-color: inherit;
                z-index: 1;
            }
        }
    }

    &-pagination {
        .block() {
            height: 36px;
            color: rgba(0, 0, 0, 0.87);
            font-size: 15px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        &-btn {
            border-radius: 2px;
            cursor: pointer;
            .block();
            min-width: 36px;
            fill: rgba(0, 0, 0, 0.26);
            transition: background-color .3s;

            &:hover {
                background-color: #f5f5f5;
                background-color: rgba(0, 0, 0, 0.03);
            }

            &.disabled {
                cursor: not-allowed;
                fill: rgba(0, 0, 0, 0.26);
                background-color: transparent !important;
            }

            input {
                height: 26px;
                outline: none !important;
                max-width: 72px;
            }
        }

        &-desc {
            .block();
            user-select: none;
            color: rgba(0, 0, 0, 0.26);

            .th-light {
                fill: rgba(0, 0, 0, 0.16);
            }
        }

        &-total {
            padding-left: 16px;
        }

        &-number {
            .block();
            min-width: 36px;
            color: rgba(0, 0, 0, 0.26);
            transition: background-color .3s;

            &.active {
                color: rgba(0, 0, 0, 0.87);
            }

            &.option {
                cursor: pointer;

                &:hover {
                    background-color: rgba(0, 0, 0, 0.03);
                }
            }
        }
    }

    .designare-spin {
        animation: designare-loading 1.2s infinite;
        @keyframes designare-loading {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }
    }

    .animate {
        .designare-transition {
            transition: color .3s, background-color .3s;
        }
    }

    .designare-highlight {
        .th() {
            background-image: linear-gradient(to bottom, #1890ff, #1890ff);
            background-size: 1px 100%;
            background-repeat: repeat-y;
        }

        .td(){
            background-image: linear-gradient(to right, #1890ff, #1890ff);
            background-size: 100% 1px;
            background-repeat: repeat-x;
        }

        &-top {
            td {
                .td;
                background-position: left top;
            }
        }

        &-bottom {
            td {
                .td;
                background-position: left bottom;
            }
        }

        &-left {
            .th;
            background-position: top left;
        }

        &-right {
            .th;
            background-position: top right;
            &:last-child {
                background-size: 2px 100%;
            }
        }
    }
    
}